#ifndef _HYPER_T_H_
#define _HYPER_T_H_

/* variable type */

typedef unsigned char      u8_t;
typedef unsigned short     u16_t;
typedef unsigned int       u32_t;
typedef unsigned long long u64_t;
typedef signed char        s8_t;
typedef signed short       s16_t;
typedef signed int         s32_t;
typedef signed long long   s64_t;
typedef unsigned long      uint_t;
typedef signed long        sint_t;
typedef sint_t             bool_t;
typedef char               char_t;
typedef unsigned long      size_t;

typedef u32_t              cpuflg_t;
typedef unsigned long      addr_t;
typedef sint_t             drvstus_t;
typedef sint_t             sysstus_t;
typedef u32_t              reg_t;
typedef void *             buf_t;
typedef sint_t             hand_t;

#define EXTERN             extern
#define KINLINE            inline 
#define FOREVER            for (;;)

#define NULL               0
#define EOS                '\0'

#define TRUE               1
#define FALSE              0
#define ERROR              (-1)
#define OK                 (0)

#define ALIGN(x, a)        (((x) + (a) - 1) & ((a) - 1)) /* 返回 x 地址对齐到 a值后的地址 */

#define LKHEAD_T           __attribute__((section(".head.text")))
#define LKHEAD_D           __attribute__((section(".head.data")))

typedef __builtin_va_list    va_list;
#define va_start(ap, np)    __builtin_va_start(ap, np)
#define va_end(ap)          __builtin_va_end(ap)
#define va_arg(ap, ty)      __builtin_va_arg(ap, ty)

#endif